home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / pmap201.arc / PMAP.DOC < prev    next >
Text File  |  1990-07-01  |  41KB  |  899 lines

  1.  
  2.                                    PMAP 2.01
  3.                                    ---------
  4.  
  5.         PMAP (Program MAP) displays how your PC's RAM is being used.  It
  6.         lists all active programs (including resident programs such as
  7.         Sidekick and PCED), displays free memory areas and their
  8.         locations, identifies device drivers, summarizes expanded memory
  9.         (EMS) use, and details certain DOS data areas.
  10.  
  11.         | identifies information about new features for PMAP 2.0.
  12.  
  13.  
  14.         Syntax summary
  15.         --------------
  16.         The command line syntax of PMAP is:
  17.  
  18.             pmap [/defkqrsvx?] [program-list]
  19.  
  20.         The option /switches are:
  21.  
  22.                 d   display detail list of allocation by programs
  23.       |         e   display programs' environments
  24.       |         f   display names of open files
  25.       |         k   display data area of DOS kernel
  26.       |         q   quick display
  27.                 r   display raw list of memory blocks
  28.                 s   display only standard DOS memory
  29.                 v   display device driver information
  30.                 x   display only expanded memory
  31.                 ?   display syntax summary
  32.  
  33.         The option switches are explained in detail below.
  34.  
  35.         The program-list, if present, restricts the display to the
  36.         listed programs.  Named programs may contain wildcards (*).
  37.  
  38.         Examples:
  39.  
  40.           pmap            (default display)
  41.           pmap /r         (raw display)
  42.           pmap /f sdump   (detail display of program SDUMP only)
  43.           pmap sdump c*   (display SDUMP and anything beginning with C)
  44.           pmap /x         (display only expanded memory usage)
  45.           pmap /v         (display only device driver data)
  46.           pmap /k         (display DOS kernel data only)
  47.  
  48.         Multiple switches may be specified together or separately.  All
  49.         of these are valid and equivalent:
  50.  
  51.             pmap /f /d
  52.             pmap /fd
  53.             pmap /f/d
  54.  
  55.       | If you wish to set "permanent" options, i.e., options that will
  56.       | be in effect for every PMAP run, set an environment variable
  57.       | called PMAP to contain the desired option switches.  For
  58.       | example, if you always want a detail list of standard memory
  59.       | only:
  60.       |
  61.       |     SET PMAP=/d /s     (or /ds)
  62.       |
  63.       | In this case, options D and S will be applied to every PMAP run.
  64.       |
  65.       | To "counter" a permanent option set in the PMAP variable, add
  66.       | a '*' to the switch.  For example, if the variable is set as
  67.       | above but you do not want the detail list, use /D*:
  68.       |
  69.       |     pmap /d*
  70.       |
  71.       | The /F and /K options are available only under DOS 3.0 or later.
  72.       |
  73.       | Note: if you have changed your switch character (SWITCHAR) from
  74.       | '/' to something else, use the new SWITCHAR for PMAP switches.
  75.  
  76.  
  77.         Standard display
  78.         ----------------
  79.         When PMAP is invoked without parameters, you'll see a display
  80.         similar to this:
  81.  
  82.  
  83.           Addr Program   Parent    Parameters     Han Blks   Size    Vectors
  84.           ---- -------  -------- ---------------  --- ----  -------  -------
  85.           147D command  command  main               0    2     3888  2E
  86.           157B nmi      command  /i/q               0    2     1856  02
  87.           15F2 cache-em command  500                0    2    13168  13 19
  88.           193E dbase    command  /C d:command      16    2   238384  30
  89.           ...
  90.       |   Other allocated blocks                         4    81296
  91.           Total conventional free memory                 4   451696
  92.           Largest conventional free block                    371168
  93.           Extended memory available                          425984
  94.           Next program will load at 5579
  95.  
  96.         Each program that is currently in memory is displayed.  Fields
  97.         are as follows:
  98.  
  99.             Addr        The memory segment at which the program is
  100.       |                 loaded, in hexadecimal.  If an asterisk (*)
  101.       |                 follows the address, the program is loaded
  102.       |                 into a disconnected high memory chain (see
  103.       |                 below).
  104.  
  105.             Program     The name of the program, if available.  "n/a"
  106.                         indicates that the name is not available.  The
  107.                         program name is never available under DOS 2.x.
  108.  
  109.             Parent      The name of the program's "parent".  In most
  110.                         cases, this will be "command", because most
  111.                         programs are run by COMMAND.COM (i.e., from
  112.                         the DOS prompt).  See below.
  113.  
  114.             Parameters  The command line parameters that were specified
  115.                         when the program was run.  Some programs re-use
  116.                         the area where the parameters are stored, in
  117.                         which case a "??" will be displayed.  An
  118.                         ellipsis ("...") at the end indicates that there
  119.                         were more parameters than could fit here.
  120.  
  121.             Han         The number of open handles (or files) associated
  122.                         with the owner.  See below.
  123.  
  124.             Blocks      The number of memory blocks that are owned by
  125.                         the program.
  126.  
  127.             Size        The total size of all blocks owned by the
  128.                         program.
  129.  
  130.             Vectors     A list of 80x8x interrupt vectors that appear to
  131.                         have been "intercepted" by the program.
  132.  
  133.         In the example, the program NMI is loaded at memory segment
  134.         157BH and was run directly from the DOS prompt or from a batch
  135.         file.  The original parameters were "/i/q".  DOS has allocated
  136.         two blocks of memory for the program, and they total 1856 bytes
  137.         in size.  Vector 2 (nonmaskable interrupt) has been
  138.         "intercepted" by NMI.
  139.  
  140.       | "Other allocated blocks" refer to blocks of memory that are not
  141.       | free but also are not owned by any executable program that PMAP
  142.       | can identify.  They may be owned by device drivers or by DOS
  143.       | itself; or they may in fact be owned by executable programs but
  144.       | not indicated as such.  PMAP may be able to make an educated
  145.       | guess as to the true owner; if so, the probable name of the
  146.       | program will be indicated in parentheses when you use the /D
  147.       | option switch (see below).
  148.  
  149.         At the end of the list, PMAP indicates the number of blocks of
  150.         free memory, the total size of all free blocks, the largest
  151.         single free block, and the segment address at which the next
  152.         program will probably load.
  153.  
  154.         The amount of available extended memory (memory above the 1
  155.         megabyte mark) is displayed only if such memory is present.
  156.  
  157.         You can restrict the display to certain programs by naming them
  158.         on the command line.  For example, the command
  159.  
  160.             pmap sdump ced
  161.  
  162.         would display information for the SDUMP and CED programs, and no
  163.         others.  The summary and expanded memory information is always
  164.         displayed.
  165.  
  166.         You can use a single wildcard '*' at the end of any named
  167.         program in the list.  For example,
  168.  
  169.             pmap sd* c*
  170.  
  171.         would display information for all programs beginning with
  172.         "sd" or "c".
  173.  
  174.         NOTE:  "below" the first program loaded in memory (usually
  175.         COMMAND.COM), there is a block of memory allocated by DOS for
  176.         device drivers, etc.  PMAP does not show this block in its
  177.       | standard display; its size is indicated under "Other allocated
  178.       | blocks" area if you request a detailed listing (/D), and further
  179.       | detail is available with the /K switch (see below).
  180.  
  181.  
  182.         Detail display (/D)
  183.         -------------------
  184.         When you run PMAP with the /D (Detail) parameter, you'll see the
  185.         same display, except that PMAP will show a detailed list of
  186.         memory blocks allocated for each program.  For example:
  187.  
  188.          Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  189.          ---- ------- -------- ------------- --- ---- ------- -------
  190.          1666 kbfix2  command  /KT1 /D0...     0    2    2560 08 09 16
  191.          1661  Environment                                 64
  192.          1666  Program                                   2496
  193.  
  194.         KBFIX2 has two memory blocks allocated to it; PMAP shows the
  195.         size of each block and its address, and makes an educated guess
  196.         as to what the block is used for.
  197.  
  198.         You may include a list of specific programs to be displayed:
  199.  
  200.             pmap sdump ced /d
  201.  
  202.         PMAP also displays a detail list of all free blocks of memory
  203.       | and of "other allocated blocks".
  204.  
  205.  
  206.       | Environment display
  207.       | -------------------
  208.       | If you add a /E switch, PMAP will display the contents of each
  209.       | program's environment (if there is one).  For example, the
  210.       | command:
  211.       |
  212.       |     pmap rxrun /e /d
  213.       |
  214.       | might display something like this:
  215.       |
  216.       |  Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  217.       |  ---- ------- -------- ------------- --- ---- ------- -------
  218.       |  B6D4  rxrun  command                  0    2    1536
  219.       |  B6D4   Program                                  1440
  220.       |  B7E3   Environment                                96
  221.       |  Environment
  222.       |    COMSPEC=C:\COMMAND.COM
  223.       |    PATH=C:\UTIL;C:\DOS
  224.       |    PROMPT=$p$g
  225.       |    [name] C:\BOOT\RXRUN.COM
  226.       |
  227.       | The [name] field appears only under DOS 3.0 and later; it shows
  228.       | the contents of the area of the environment where the full path
  229.       | and name of the program are stored.
  230.  
  231.  
  232.       | Open files display (/F)
  233.       | -----------------------
  234.       | If the HAN field in the standard display is non-zero, the named
  235.       | program currently has files that are open.  You can display the
  236.       | names of these files by adding the /F option.  For example:
  237.       |
  238.       |  Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  239.       |  ---- ------- -------- ------------- --- ---- ------- -------
  240.       |  12CD  command  command  /f            1    2  4176  22 23 24 2E
  241.       |  Open files: D:FOPT.TXT
  242.       |
  243.       | This feature is available only under DOS 3.0 and later and is
  244.       | mutually exclusive with the /Q (Quick) switch.
  245.       |
  246.       |
  247.       | Quick display (/Q)
  248.       | ------------------
  249.       | Some of what PMAP does can be somewhat time consuming on slower
  250.       | computer systems, and one task may fail under some versions of
  251.       | DOS.  If you would like PMAP to run slightly faster (about 1/2
  252.       | second on a 4.77Mhz machine if you have EMS) or if PMAP fails
  253.       | with an error message similar to:
  254.       |
  255.       |         pmap: error trading buffer chain
  256.       |
  257.       | then use the /Q (Quick) option switch.  With /Q set, PMAP will
  258.       | not:
  259.       |
  260.       |     1. Search for a disconnected high memory chain, or
  261.       |     2. Look for buffers, files, stacks, etc.
  262.       |
  263.       | The /K and /F options cannot be used with /Q.  Also note that /Q
  264.       | will have little effect on PMAP's speed unless you have expanded
  265.       | memory (EMS) and that /Q is automatically set for DOS versions
  266.       | prior to 3.0.
  267.       |
  268.       | Remember, if you always want to use the /Q switch, you can
  269.       |
  270.       |     SET PMAP=/Q
  271.       |
  272.       | in your environment.
  273.  
  274.  
  275.       | Kernel display (/K)
  276.       | -------------------
  277.       | Below the first program loaded into memory (usually COMMAND.COM)
  278.       | there is an area of memory used by DOS for storage of code and
  279.       | data.  This area is broken into three major sections:
  280.       |
  281.       |     1. IBMBIO's code and data.  This is always located at memory
  282.       |     segment 0070h and contains the basic code and data for
  283.       |     system input/output services.  The default device drivers
  284.       |     (for the printer, screen, and keyboard, etc.) are also
  285.       |     located here.
  286.       |
  287.       |     2. IBMDOS's basic code and data.  This is located in memory
  288.       |     immediately following IBMBIO's area and contains the "guts"
  289.       |     of DOS.  This area usually includes space for five FILES
  290.       |     and one BUFFER.
  291.       |
  292.       |     3. A supplementary DOS data area.  This area may include:
  293.       |         - your FCBs; the size is affected by the FCBS option
  294.       |           in your CONFIG.SYS.
  295.       |         - any FILES beyond the initial number (usually 5) that
  296.       |           are stored in the IBMDOS area.  This size of this area
  297.       |           is determined by the FILES option in CONFIG.SYS.
  298.       |         - any BUFFERS beyond the initial number (usually 1) that
  299.       |           are stored in the IBMDOS area.  The size of this area
  300.       |           is determined by the BUFFERS option in CONFIG.SYS.
  301.       |         - your logical drive table.  There is one entry in this
  302.       |           table for each drive up to LASTDRIVE.
  303.       |         - your DOS STACKS, if any (DOS 3.1 or later only).  The
  304.       |           size of this area is determined by the STACKS option
  305.       |           in CONFIG.SYS.
  306.       |         - any externally loaded device drivers such as ANSI.SYS.
  307.       |
  308.       | To display a detailed map of the complete DOS memory area (all
  309.       | three of the above), use the /K option.  The display might look
  310.       | something like this:
  311.       |
  312.       |    MCB Addr  End   Size  Contents
  313.       |   ---- ---- ----  -----  --------
  314.       |    --  0070 0279   8352  IBMBIO [includes 13 device drivers]
  315.       |    --  027A 09C7  29920  IBMDOS [includes 5 files, 1 buffer]
  316.       |   09C8 09C9 1282  35760  DOS data/drivers
  317.       |
  318.       |   DOS data/drivers area detail:
  319.       |        09C9 0E9B  19760    8 device drivers (PMAP /V for detail)
  320.       |        0E9C 0F10   1872   35 files
  321.       |        0F11 0F1E    224    4 FCBs
  322.       |        0F1F 1191  10032   19 buffers
  323.       |        1192 11B5    576    7 logical drives
  324.       |        11B6 1282   3280    9 stacks (128 bytes each)
  325.       |
  326.       | The first section shows the locations and sizes of the three
  327.       | major areas used by DOS.  In this case, for example, area 2 (the
  328.       | basic IBMDOS code/data area) begins at memory segment 027Ah and
  329.       | is 29,920 bytes in size.  It includes five files and one buffer.
  330.       |
  331.       | The MCB field, which only appears for area 3, shows the address
  332.       | of the memory control block for the area.  This is part of DOS's
  333.       | memory management scheme and is decribed in greater detail later
  334.       | in this manual.  Areas 1 and 2 are not part of DOS's official
  335.       | memory chain, so they have no MCBs.
  336.       |
  337.       | The second section breaks down the contents of area 3 in greater
  338.       | detail.  In the example system, eight device drivers are
  339.       | loaded and the system is configured as follows:
  340.       |
  341.       |         FILES=40
  342.       |         BUFFERS=20
  343.       |         LASTDRIVE=G
  344.       |         STACKS=9,128
  345.       |         FCBS=4,0
  346.       |
  347.       | The display shows the exact location and size of each of these
  348.       | items.  For example, the extra 19 buffers (there's one in area
  349.       | 2, leaving 19 of the 20 for area 3) are located at memory
  350.       | segment 0F1Fh and extend through the end of memory segment
  351.       | 1191h, a total of 10,032 bytes.
  352.       |
  353.       | If you use an extender program such as QEMM's FILES.COM to
  354.       | increase the number of FILES after bootup, storage for the extra
  355.       | files will be located elsewhere in the memory chain--not in
  356.       | any of the DOS data areas described.  PMAP will display such
  357.       | areas in a separate section if there are any.  For example, if
  358.       | we ran:
  359.       |
  360.       |     FILES + 2
  361.       |
  362.       | to increase the maximum number of files from 40 to 42, the
  363.       | display might appear as follows:
  364.       |
  365.       |     Additional memory block(s) used for DOS data:
  366.       |      MCB Addr  End   Size  Contents
  367.       |     ---- ---- ----  -----  --------
  368.       |     1897 1898 18C8    784
  369.       |       >> 18C1 18C7    112   2 files
  370.       |
  371.       | This shows that the 944-byte block from 1403h to 143Dh (with MCB
  372.       | at 1402h) is used for supplementary DOS data.  Within this
  373.       | 944-byte allocation, the 272 bytes from memory segments 142Ch
  374.       | through 143Ch contain the actual storage for information about
  375.       | the five files.
  376.       |
  377.       | Note also that, if there are additional blocks such as these,
  378.       | they are identified in the standard program display if you use
  379.       | the /D (detail) option.  The above might look something like
  380.       | this in the detail display:
  381.       |
  382.       |  Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  383.       |  ---- ------- -------- ------------- --- ---- ------- -------
  384.       |  1898 n/a     command  +2              0    1     784
  385.       |  1898   2 files                                   784
  386.       |
  387.       | The /K option is available only under DOS 3.0 and later.
  388.  
  389.  
  390.         Raw display
  391.         -----------
  392.         When you run PMAP with the /r (Raw) parameter, you'll see a
  393.         display like this:
  394.  
  395.             T  MCB  Addr  Owner  Para    Bytes
  396.             - ----  ----  -----  ----  --------
  397.             M 0974  0975   0008  0AFA     44960
  398.             M 146F  1470   1470  00C3      3120
  399.             M 1533  1534   1470  0020       512
  400.                [more of the same]
  401.             M 1DF3  1DF4   1DF4  0706     28768
  402.             M 24FA  24FB   2500  0004        64 [pmap]
  403.             M 24FF  2500   2500  1376     79712 [pmap]
  404.             Z 3876  3877   0000  6789    424080
  405.  
  406.         This is an uninterpreted list of all blocks of memory allocated
  407.         by DOS (see below).  The fields are as follows:
  408.  
  409.             Type        The block type.  There are only two block types,
  410.                         type M and type Z.  The last block in the
  411.                         chain is type Z, and all others are type M.
  412.  
  413.             MCB         The segment address of the Memory Control Block
  414.                         (sometimes known as an arena header).
  415.  
  416.             Addr        The segment address of the memory block itself.
  417.                         This is always equal to the MCB address plus
  418.                         one.
  419.  
  420.             Owner       The segment address of the program that "owns"
  421.                         the block of memory.  If this is 0000, the block
  422.                         is unallocated or "free".
  423.  
  424.             Para        The size of the block, in paragraphs (16 bytes).
  425.  
  426.             Bytes       The size of the block, in bytes.
  427.  
  428.         All numbers are hexadecimal except "bytes", which is decimal.
  429.  
  430.         The [pmap] suffix after an allocated block indicates that the
  431.         block is being used by PMAP.  When PMAP terminates, this block
  432.         will be free (unallocated).  The standard (non-raw) PMAP display
  433.         understands this, and displays the map as if PMAP weren't there.
  434.  
  435.       | Following some lines on the display you may see a one- to
  436.       | eight-character string:
  437.       |
  438.       |     T  MCB  Addr  Owner  Para    Bytes
  439.       |     - ----  ----  -----  ----  --------
  440.       |     M 1533  1534   1470  0020       512 GLVMGR
  441.       |
  442.       | Under DOS 4.0 and later, a program name may appear in the last
  443.       | eight bytes of a memory control block (which is what the raw
  444.       | display is showing).  Under DOS versions prior to 4.0, DOS does
  445.       | not place the program name in this location, but some other
  446.       | programs (such as 386MAX and QEMM) may do so.  If PMAP thinks
  447.       | that the contents of the last eight bytes of the MCB look like a
  448.       | readable string, it will display the string.  This may provide
  449.       | some information about the owner of the block.
  450.       |
  451.       | If PMAP is able to identify a disconnected high memory chain, it
  452.       | will display the line:
  453.       |
  454.       |     Disconnected high memory chain:
  455.       |
  456.       | between the regular low-RAM DOS memory chain and the "hidden"
  457.       | high memory chain.
  458.  
  459.         If the /R switch is included, all other command line parameters
  460.         are ignored.
  461.  
  462.  
  463.         Expanded memory display
  464.         -----------------------
  465.         If expanded (LIM or EEMS) memory is present, PMAP displays EMS
  466.         allocation as follows:
  467.  
  468.             Expanded memory summary:
  469.  
  470.                     Block      Size    Name
  471.                     -----    -------   ----
  472.                     0         589824   SYSTEM
  473.                     1         425984
  474.                     2          16384   CDIR
  475.                     3          65536   HINDSITE
  476.                     ...
  477.                     Free      327680
  478.                     Total    2097152
  479.                     Page frame segment: CC00h
  480.  
  481.         The NAME field will be present only if your expanded memory
  482.         manager supports the LIM 4.0 specification, and then only for
  483.         programs that have defined their names to the system.
  484.  
  485.         EMS memory uses a "page frame" that maps a 64K block (actually,
  486.         four 16K "pages") of EMS memory into standard 80x8x memory.
  487.         The segment to which this memory is mapped is also displayed.
  488.  
  489.         If you only want to display the expanded memory allocation, use
  490.         the /X switch.  To suppress the display of expanded memory, use
  491.         /S.
  492.  
  493.  
  494.         Device driver display
  495.         ---------------------
  496.         If you execute PMAP with the /V switch, it will display a table
  497.         of information about your installed device drivers.  No other
  498.         data (i.e., no memory maps) are displayed when /V is selected.
  499.  
  500.         The first five columns of the table contain the following
  501.         fields:
  502.  
  503.             Name        If the device is a character device, the device
  504.                         name.  If it is a block device (like a disk),
  505.                         this will be "Blk (n)", where n is the number
  506.                         of units handled by this device.
  507.  
  508.             Address     The address where the device driver begins in
  509.                         memory, in standard hex segment:offset form.
  510.  
  511.             Size        The approximate size (in bytes, displayed in
  512.                         decimal) of the device driver.  See below.
  513.  
  514.             Strt        The entry point of the driver's strategy
  515.                         routine.  This is the hex offset within the
  516.                         device driver's segment (shown under ADDRESS).
  517.  
  518.             Intr        The entry point of the driver's interrupt
  519.                         routine.  This is the hex offset within the
  520.                         device driver's segment (shown under ADDRESS).
  521.  
  522.         The remaining columns are bit fields with the driver's attribute
  523.         record.  In each case, an asterisk indicates that the bit is
  524.         set (1), and a space indicates that it is reset (0).
  525.  
  526.             CHR         *    = this is a character device
  527.                         <sp> = this is a block device.
  528.  
  529.             IOC         *    = device supports IOCTL calls
  530.  
  531.             IBM    for block devices:
  532.                         *    = non-IBM format
  533.                    for character devices:
  534.                         *    = supports output-until-busy
  535.  
  536.             RMV         *    = supports removable media
  537.  
  538.             LOG         *    = supports Get/Set Logical Device
  539.  
  540.             CLK         *    = this is the clock device
  541.  
  542.             NUL         *    = this is the NUL device
  543.  
  544.             SOT         *    = this is this standard output device
  545.  
  546.             SIN    for block devices:
  547.                         *    = supports generic IOCTL
  548.                    for character devices
  549.                         *    = this is the standard input device
  550.  
  551.         Note that <space> implies the opposite of <*>; for example, an
  552.         asterisk in IOC indicates that the device supports IOCTL calls,
  553.         while a space there indicates that IOCTL is not supported.
  554.  
  555.         Also note that DOS does not provide any documented way for
  556.         programs to find the chain of device drivers.  If PMAP is unable
  557.         to find the chain, it will tell you so.
  558.  
  559.  
  560.         Device driver size; order of list
  561.         ---------------------------------
  562.         PMAP cannot reliably determine the size of the default devices
  563.         (CON, PRN, AUX, COM1, etc.) that are loaded automatically by DOS
  564.         (they share code and data).  These will all show an address
  565.         beginning with "0070", and their sizes will not be displayed.
  566.         However, if you load a replacement for one of these devices (for
  567.         example, ANSI.SYS loads a replacement for CON), PMAP will
  568.         generally be able to determine and display its size.
  569.  
  570.         The devices are shown in the order in which DOS searches for
  571.         them.  If there are two or more devices with the same name, the
  572.         one that DOS will use is the first one listed.  For example, you
  573.         will have two or more CON devices if you use ANSI.SYS; the
  574.         ANSI.SYS CON will be listed before the default CON.  DOS will
  575.         use the first one listed (ANSI.SYS).
  576.  
  577.  
  578.       | Disconnected high memory chains
  579.       | -------------------------------
  580.       | DOS manages memory by using a "chain" of allocated memory blocks
  581.       | as described below.  This chain normally ends at the 640K mark
  582.       | (segment A000), as memory addresses above this address are
  583.       | reserved for use by video adapters (some programs such as
  584.       | EEMRAM, QEMM, and 386MAX may extend the chain to B000 or B800).
  585.       | By following the links in this chain, PMAP is able to map your
  586.       | DOS memory and determine what programs own what areas of memory.
  587.  
  588.       | However, Quarterdeck's QEMM and Qualitas' 386MAX may create an
  589.       | additional chain of allocated memory blocks in "high RAM" above
  590.       | the video adapter memory area.  Using a "high load" feature,
  591.       | these programs can load your resident utilities and device
  592.       | drivers into the high RAM chain, thus increasing the memory
  593.       | available to DOS in low RAM.
  594.       |
  595.       | The high RAM chain is not connected to DOS's standard low RAM
  596.       | chain (unless you use 386MAX's OPENHIGH option), and versions of
  597.       | PMAP prior to 2.0 would not find it; therefore programs loaded
  598.       | into high RAM were not displayed.
  599.       |
  600.       | Beginning with version 2.0, however, PMAP attempts to locate
  601.       | these "high memory chains" and identify the programs loaded
  602.       | there.  If PMAP succeeds in finding the chain and there are
  603.       | programs loaded in it, such programs will be marked with an
  604.       | asterisk (*) in the program display.  In raw block display mode
  605.       | (/R), the two chains (low and high) are shown separately.
  606.  
  607.  
  608.         Interrupt vectors
  609.         -----------------
  610.         Many times interrupts are "intercepted" by more than one
  611.         resident program.  PMAP will only show a vector attached to the
  612.         LAST program that intercepted it.  For example, KBFIX2 shows
  613.         that it has intercepted vectors 8, 9, and 16.  However, RXINTMGR
  614.         and SDUMP could also have intercepted any or all of these three
  615.         vectors, and PMAP would not know about that.
  616.  
  617.         PMAP assumes that any vector that points into memory owned by a
  618.         program has been intercepted by that program.  That is not
  619.         always true, so you may occasionally see spurious vectors
  620.         attached to a program.
  621.  
  622.  
  623.         More about parents
  624.         ------------------
  625.         Every program has a "parent"; if program B was executed by
  626.         program A, then A is B's parent.  In most cases, the parent will
  627.         be COMMAND.COM, because most PC programs are executed by
  628.         COMMAND.COM.
  629.  
  630.         However, any program can execute any other program (assuming
  631.         that there is sufficient memory, etc.).  This is how "shells"
  632.         work.  For example, current versions of WordPerfect and many
  633.         other programs allow you to "exit to DOS"; what they usually do
  634.         is execute COMMAND.COM, which then displays a DOS prompt and
  635.         allows you to enter any commands that you wish.  If you run
  636.         PMAP, you will see two copies of COMMAND.COM in memory.
  637.  
  638.         However, you may notice that the second copy of COMMAND.COM
  639.         shows COMMAND.COM as its parent.  Logically, you would expect
  640.         the parent to be (in this case) WordPerfect.  Unfortunately,
  641.         some versions of COMMAND.COM (the one that comes with DOS 3.2,
  642.         for example) fool around with the area of memory that PMAP uses
  643.         to find the parent's address; rather than having the parent's
  644.         address, COMMAND.COM puts its own address there.  In effect,
  645.         COMMAND.COM is always its own parent.
  646.  
  647.         In general, programs that allow you to execute other programs
  648.         can use one of two methods: they can execute the other programs
  649.         directly, or the can execute COMMAND.COM and ask it to run the
  650.         requested program.  If the former, PMAP will show the true
  651.         parent; if the latter, PMAP will show COMMAND.COM, and
  652.         COMMAND.COM will be its own parent.
  653.  
  654.         Here is part of a PMAP display that shows a direct-execution
  655.         under DOS 3.2:
  656.  
  657.             Addr  Program    Parent   Han  Blks    Size    Vectors
  658.             ----  -------   --------  ---  ----   -------  -------
  659.             ...
  660.             3222  xced      command     0     2     26016
  661.             387E  qe        xced        0     3     97232
  662.             503E  command   command     0     3      3488  22 23 24
  663.             ...
  664.  
  665.         The XCED program was run by COMMAND.COM (from the DOS prompt).
  666.         It then ran the program QE directly, i.e., without reloading
  667.         COMMAND.COM.  Finally, a "shell" exit was taken from QE, which
  668.         did reload COMMAND.COM; notice that COMMAND shows as its own
  669.         parent.
  670.  
  671.  
  672.         File handles
  673.         ------------
  674.         The "Han" field of the standard memory display shows the number
  675.         of file handles that are associated with each program.  For the
  676.         most part, this field will be zero.  Some open handles may show
  677.         for programs that are active (for example, the active program
  678.         named "dbase" in the first example has 16 open files).
  679.  
  680.       | Use the /F option to see the names of the open files.
  681.  
  682.         You may see some resident programs that show one or more open
  683.         handles.  This usually occurs when you redirect the program's
  684.         start-up logo to NUL, and the program fails to close its
  685.         standard files before exiting back to DOS (this really shouldn't
  686.         be necessary, but it is).  These open handles may reduce the
  687.         number of files your application programs can have
  688.         simultaneously open.  We prefer not to redirect programs' logos
  689.         to NUL.  We save file handles; we get to see the names of the
  690.         nice people who wrote our software, and their copyrights; and we
  691.         don't lose the error messages that explain why the program isn't
  692.         doing what we thought it should.  Sounds like a bargain.
  693.  
  694.  
  695.         Multi-tasking/task-switching programs
  696.         -------------------------------------
  697.         ... play havoc with the memory allocation chain.  PMAP may
  698.         not yield very much useful information under such programs.
  699.  
  700.  
  701.         DOS's memory allocation chain
  702.         -----------------------------
  703.         This information is almost totally undocumented by Microsoft, so
  704.         take it for what's it's worth.  It's provided for informational
  705.         purposes only, and could vary from DOS version to DOS version.
  706.  
  707.         DOS (version 2.00 or later) manages memory as a chain of
  708.         "blocks".  Each block begins on a paragraph boundary, can be (in
  709.         theory) almost a megabyte in size, and is preceded immediately
  710.         by a 16-byte Memory Control Block (MCB), sometimes known as an
  711.         "arena header".  The lowest (the 80x8x interrupt vectors, BIOS
  712.         and DOS data areas, DOS itself, device drivers, etc.) and
  713.         highest (video buffers, ROM modules) portions of memory are not
  714.         mapped, but the rest of memory is.  Thus, memory can be pictured
  715.         like this:
  716.  
  717.             paragraph   contents
  718.             ---------
  719.               0000      low memory (unmapped)
  720.                         first MCB (16 bytes)
  721.                         first memory block
  722.                         next MCB
  723.                         next memory block
  724.                         ...
  725.                         last MCB
  726.                         last memory allocation block
  727.               nnnn      end of DOS memory (640K, for example)
  728.  
  729.         The address of the first MCB will vary, depending on your
  730.         version of DOS, and the number and size of device drivers,
  731.         buffers, stacks, etc., that you loaded via CONFIG.SYS.  In all
  732.         current versions of DOS (verified through 4.01), the segment
  733.         address of the first MCB can be obtained via DOS function 52H.
  734.         On return from this function, the address of the first MCB is
  735.         located at ES:[BX-2].  Here is sample code that returns the
  736.         address of the first MCB in AX:
  737.  
  738.             mov ah,52H
  739.             int 21H
  740.             mov ax,es:[bx-2]
  741.  
  742.         The MCB itself is a 16-byte region of memory that with fields as
  743.         follows:
  744.  
  745.             Offset  Size    Contents
  746.             ------  ----    --------
  747.             0       Byte    'M': this is not the last MCB
  748.                             'Z': this is the last MCB
  749.                             anything else: memory control blocks
  750.                             destroyed.  DOS will politely crash.
  751.  
  752.             1       Word    The segment address of the program that owns
  753.                             this block of memory (the program's PSP).
  754.  
  755.             3       Word    The size of the block, in paragraphs
  756.  
  757.             5-7             Reserved
  758.  
  759.             8-15     n/a    ASCIIZ name of owner program (DOS 4.0+ only)
  760.  
  761.         This structure provides all of the information needed to step
  762.         through the memory allocation chain.  A basic algorithm is as
  763.         follows:
  764.  
  765.             Set MCB = segment of first MCB (as described above)
  766.             Do Until byte (MCB:0) = 'Z'
  767.                 If byte (MCB:0) isn't 'M' or 'Z',
  768.                     Then there's a big problem (the system is about
  769.                     to crash with a "memory allocation error")
  770.                 Block_owner = word (MCB:1)
  771.                 Block_size = word (MCB:3)
  772.                 MCB = MCB + block_size + 1
  773.             End
  774.  
  775.         EMS and EEMS memory is not, of course, mapped by DOS.
  776.  
  777.         For more complete detail about DOS's memory allocation, see
  778.         "Managing Memory" by William J. Redmond in PC Tech Journal,
  779.         August, 1984 (Vol. 2, No. 2).
  780.  
  781.  
  782.         Version 2.01 (6/7/90)
  783.         ---------------------
  784.         Fixes a problem that prevented PMAP from working on systems
  785.         with no expanded memory.
  786.  
  787.         Version 2.00 (6/5/90)
  788.         -----------------------
  789.         - Attempts to identify disconnected high-RAM chains
  790.         - Adds /F (files) option
  791.         - Adds /E (environment) option
  792.         - Adds /K (kernel display) option and identifies areas of the
  793.           DOS data block used for files, buffers, stacks, etc.
  794.         - Adds /Q (quick display) option
  795.         - Supports permanent options via PMAP variable
  796.         - Correctly reports size of last installed device driver
  797.         - Supports altered switch characters
  798.         - Shows program name in raw display if available from
  799.           environment.
  800.         - Uses correct number of available file handles with extended
  801.           handle tables (old versions assumed 20 handles)
  802.  
  803.         Version 1.34 (11/15/88)
  804.         -----------------------
  805.         Fixes a bug in 1.33 for resident programs that release their
  806.         environments under DOS 4.0.
  807.  
  808.         Version 1.33 (11/14/88)
  809.         -----------------------
  810.         Uses a new feature of DOS 4.0 to more reliably obtain names of
  811.         resident programs, including those installed via INSTALL.
  812.  
  813.         Version 1.31/1.32 (7/29/88)
  814.         -----------------
  815.         Displays number of open handles for each PSP.
  816.         Displays sizes of some devices (/V switch).
  817.         Improved display when too many vectors to fit on one line.
  818.         Fixed spurious errorlevel returned by successful run (32).
  819.  
  820.         Version 1.30
  821.         ------------
  822.         Adds /X, /S, and /? switches.
  823.         Adds device driver display (/V).
  824.         Displays names of EMS-users when available (LIM 4.0 only).
  825.         Allows wildcards in program-list.
  826.         Fixes problem with name of secondary copies of COMMAND.COM
  827.             under DOS 3.3 (it's not available).
  828.  
  829.         Version 1.26
  830.         ------------
  831.         Corrects a problem detecting extended memory with certain
  832.         versions of BIOS ROM.
  833.  
  834.         Version 1.25
  835.         ------------
  836.         Adds the extended memory display and the selective display
  837.         option.
  838.  
  839.         Corrects a minor problem with DOS 3.3.
  840.  
  841.         Version 1.21
  842.         ------------
  843.         Bug fixes to version 1.20:
  844.  
  845.         1. No more runaway display when EMS memory is present but none
  846.         of it is in use.
  847.  
  848.         2. PMAP is more careful about what it thinks is the name of the
  849.         command shell.
  850.  
  851.  
  852.         Copyright/License/Warranty
  853.         --------------------------
  854.         This document and the program file PMAP.EXE ("the software") are
  855.         copyrighted by the author.  The copyright owner hereby licenses
  856.         you to: use the software; make as many copies of the program and
  857.         documentation as you wish; give such copies to anyone; and
  858.         distribute the software and documentation via electronic means.
  859.         There is no charge for any of the above.
  860.  
  861.         However, you are specifically prohibited from charging, or
  862.         requesting donations, for any such copies, however made; and
  863.         from distributing the software and/or documentation with
  864.         commercial products without prior permission.  An exception is
  865.         granted to not-for-profit user's groups, which are authorized to
  866.         charge a small fee (not to exceed $7) for materials, handling,
  867.         postage, and general overhead.  NO FOR-PROFIT ORGANIZATION IS
  868.         AUTHORIZED TO CHARGE ANY AMOUNT FOR DISTRIBUTION OF COPIES OF
  869.         THE SOFTWARE OR DOCUMENTATION, OR TO INCLUDE COPIES OF THE
  870.         SOFTWARE OR DOCUMENTATION WITH SALES OF THEIR OWN PRODUCTS.
  871.  
  872.         THIS INCLUDES A SPECIFIC PROHIBITION AGAINST FOR-PROFIT
  873.         ORGANIZATIONS DISTRIBUTING THE SOFTWARE, EITHER ALONE OR WITH
  874.         OTHER SOFTWARE, AND CHARGING A "HANDLING" OR "MATERIALS" FEE OR
  875.         ANY OTHER SUCH FEE FOR THE DISTRIBUTION.  NO FOR-PROFIT
  876.         ORGANIZATION IS AUTHORIZED TO INCLUDE THE SOFTWARE ON ANY MEDIA
  877.         FOR WHICH MONEY IS CHARGED.  PERIOD.
  878.  
  879.         There is no restriction on the use of this software in
  880.         commercial or institutional environments.
  881.  
  882.         No copy of the software may be distributed or given away without
  883.         this document; and this notice must not be removed.
  884.  
  885.         There is no warranty of any kind, and the copyright owner is not
  886.         liable for damages of any kind.  By using this free software,
  887.         you agree to this.
  888.  
  889.         The software and documentation are:
  890.  
  891.                     Copyright (C) 1986, 1987, 1988, 1990 by
  892.                             Christopher J. Dunford
  893.                             The Cove Software Group
  894.                                  P.O. Box 1072
  895.                            Columbia, Maryland 21044
  896.  
  897.                                 (301) 992-9371
  898.                         CompuServe 76703,2002 [IBMNET]
  899.